<?php

class Core_Data_UDD_Structure_Field {

    public $Table;

    public $strName;
    public $constDataType;
    public $constKeyType;
    public $boolRequired = false;

    function __construct ( Core_Data_UDD_Structure_Table $objTable, $strName, $constDataType ) {
        $this->Table = $objTable;
        $this->strName = $strName;
        $this->constDataType = $constDataType;
    }

    function __toString () {
        return $this->strName;
    }

    public function getDataType () {
        return $this->constDataType;
    }

    public function isKey () {
        return ( $this->constKeyType ) ? true : false;
    }

    public function setKey ( $constKeyType = Core_Data_UDD::KEY_UNIQUE ) {
        $this->constKeyType = $constKeyType;
    }

    public function getKeyType () {
        return $this->constKeyType;
    }

    public function isRequired () {
        return $this->boolRequired;
    }

    public function setRequired () {
        $this->boolRequired = true;
    }

}

?>
